<%-- 
    Document   : topVenditori
    Created on : 11-gen-2013, 11.23.19
    Author     : Luciano
--%>

<%@page import="java.util.List"%>
<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.items.User"%>
<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.DBManager"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%!
    private DBManager db;
        
    @Override
    public void init() throws UnavailableException{
            db=(DBManager)super.getServletContext().getAttribute("db_manager");
            
    }
%>      

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Top Buyer</title>
    </head>
    <body>
        <%
         List<User> topVenditori = db.getTopSellers();
        %>
        <div class="content">
            <h2>Top seller:</h2>
            <%
               int i=1;
               for(User seller:topVenditori){
                                          
             %>   
             <h4><%=i%>°</h4> 
                  <h4>Seller username:</h4>
                  <a href="<%=response.encodeURL(request.getContextPath()+"/contents/user/userDetails?id="+seller.getId())%>"
                           ><p><%=seller.getUsername()%></p> 
                  </a> 
            <%
                 i++;
              }
            %>                      
        </div>
    </body>
</html>